import VueRouter from 'vue-router'

import HomeContainer from "./components/tabbar/homeContainer.vue"
import MemberContainer from './components/tabbar/memberContainer.vue'
import ShopcarContainer from './components/tabbar/shopcarContainer.vue'
import SearchContainer from './components/tabbar/searchContainer.vue'
import NewsList from './components/news/newslist.vue'
import NewsInfo from './components/news/newsInfo.vue'
import ImgList from './components/imgBox/imgList.vue'
import ImgCon from './components/imgBox/imgCon.vue'
import ImgConDet from './components/imgBox/imgConDet.vue'
import ImgConComment from './components/imgBox/ImgConComment.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    { path: "/", redirect: "/home" },
    { path: "/home", component: HomeContainer },
    { path: "/member", component: MemberContainer },
    { path: "/shopcar", component: ShopcarContainer },
    { path: "/search", component: SearchContainer },
    { path: "/home/newslist", component: NewsList },
    { path: "/home/newsinfo/:id", component: NewsInfo },
    { path: "/home/imgList", component: ImgList },
    { path: "/home/imgCon/:id", component: ImgCon },
    { path: "/home/imgConDet/:id", component: ImgConDet, name: "imgConDet"},
    {path:"/home/imgConComment/:id", component: ImgConComment, name:"imgConComment"}
  ],
  linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router